<template>
  <div>
    <button @click="fetchData">获取数据</button>
    <div v-html="data"></div>
  </div>
</template>
<script>
import axios from 'axios'

export default {
  data() {
    return {
      data: null
    }
  },
  methods: {
    async fetchData() {
      try {
        const response = await axios.get(
          'https://yesno.wtf',
        );
        console.log(response)
        this.data = response.data;
      } catch (err) {
        console.log(err)
      }
    }
  }
}
</script>